    <!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="author" content="nodejh">
		<meta name="description" content="Describe your website">
		<meta name="generator" content="Hugo 0.16" />
		<title>Install Opencv3 for Python3.5 on Mac OS X &middot; nodejh</title>
		<link rel="shortcut icon" href="http://nodejh.com/images/favicon.ico">
		<link rel="stylesheet" href="http://nodejh.com/css/style.css">
		
		<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/styles/atom-one-light.min.css">
		

		
		<link rel="stylesheet" href="http://nodejh.com/fontawesome/css/font-awesome.min.css">
		

		
		<link href="http://nodejh.com/index.xml" rel="alternate" type="application/rss+xml" title="nodejh" />
		
	</head>

    <body>
       <nav class="main-nav">
	
	
		<a href='http://nodejh.com/'> <span class="arrow">←</span>Home</a>
	

	
		<a href='http://nodejh.com/post'>Archive</a>
	

	
		<a href='http://nodejh.com/about'>About</a>
	

	
	<a class="cta" href="http://nodejh.com/index.xml">Subscribe</a>
	
</nav>


        <section id="wrapper">
            <article class="post">
                <header>
                    <h1>Install Opencv3 for Python3.5 on Mac OS X</h1>
                    <h2 class="headline">
                    Aug 1, 2016 21:17
                    · 97 words
                    · 1 minute read
                      <span class="tags">
                      
                      
                          
                              <a href="http://nodejh.com/tags/python">Python</a>
                          
                              <a href="http://nodejh.com/tags/opencv">opencv</a>
                          
                      
                      
                      </span>
                    </h2>
                </header>
                <section id="post-body">
                    

<h2 id="通过-homebrew-安装-opencv">通过 homebrew 安装 opencv</h2>

<p>通过 homebrew 安装在 Mac OS X 上安装为 Python3.5 安装 Opencv3：</p>

<pre><code>$ brew install opencv3 --with-python3
......
......
This formula is keg-only, which means it was not symlinked into /usr/local.

opencv3 and opencv install many of the same files.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/opencv3/lib
    CPPFLAGS: -I/usr/local/opt/opencv3/include

==&gt; Summary
</code></pre>

<p>安装完成后，会有如上提示。接下来需要做的事，将 <code>opencv3</code> 的 <code>site-packegs</code> 链接到 <code>Python3</code> 的 <code>site-packegs</code>:</p>

<pre><code>echo /usr/local/opt/opencv3/lib/python3.5/site-packages &gt;&gt; /usr/local/lib/python3.5/site-packages/opencv3.pth
</code></pre>

<h2 id="检查是否安装成功">检查是否安装成功</h2>

<pre><code>$ python
&gt;&gt;&gt; import cv2
&gt;&gt;&gt; cv2.__version__
'3.1.0'
</code></pre>

                </section>
            </article>

            <div id="disqus_thread"></div>
<div style="margin-top: 50px">
  评论: 请点击 Gtihub Issue 链接跳转到评论页面
</div>
</div>


            <footer id="footer">
    
        <div id="social">

	
	
    <a class="symbol" href="https://www.facebook.com/nodejh">
        <i class="fa fa-facebook-square"></i>
    </a>
    
    <a class="symbol" href="https://www.github.com/nodejh">
        <i class="fa fa-github"></i>
    </a>
    
    <a class="symbol" href="http://stackoverflow.com/users/4518882/nodejh">
        <i class="fa fa-stack-overflow"></i>
    </a>
    
    <a class="symbol" href="https://www.twitter.com/nodejh">
        <i class="fa fa-twitter"></i>
    </a>
    


</div>

    
    <p class="small">
    
        © Copyright 2016 <i class="fa fa-heart" aria-hidden="true"></i> nodejh
    
    </p>
</footer>

        </section>

        <script   src="https://code.jquery.com/jquery-2.2.4.js" integrity="sha256-iT6Q9iMJYuQiMWNd9lDyBUStIq/8PuOW33aOqmvFpqI="   crossorigin="anonymous"></script>
<script src="http://nodejh.com/js/main.js"></script>

<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>




<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-84989670-1', 'auto');
ga('send', 'pageview');
</script>


    </body>
</html>
